using System;
using System.Windows.Forms;
using System.Threading;
using System.Net.Sockets;
using System.IO;
using System.Drawing;

namespace MapAndCharacter_Filip
{
#if WINDOWS || XBOX
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main(string[] args)
        {
            string startupPath = Path.Combine(Directory.GetParent(System.IO.Directory.GetCurrentDirectory()).Parent.Parent.Parent.FullName, "Natural_20.xml");
            Console.WriteLine(startupPath);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            ControlPanel panel = new ControlPanel();
            panel.StartPosition = FormStartPosition.Manual;
            panel.Location = new Point(830, 10);
            Thread controlPanel = new Thread(() => Application.Run(panel));
            controlPanel.SetApartmentState(ApartmentState.STA);
            controlPanel.Start();

            using (GameState.game = new Game())
            {
                while (true)
                {
                    while (!GameState.GameStarted) { }
                    GameState.game.Run();
                }
            }
        }
    }
#endif
}

